package com.atguigu.tingshu.order.mapper;

import com.atguigu.tingshu.model.order.OrderDerate;
import com.atguigu.tingshu.model.order.OrderDetail;
import com.atguigu.tingshu.model.order.OrderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {

    /**
     * 分页获取当前用户订单列表
     *
     * @param pageInfo 分页参数
     * @param userId   用户id
     * @return 订单列表分页对象
     */
    Page<OrderInfo> selectUserOrderByPage(Page<OrderInfo> pageInfo, @Param("userId") Long userId);

    /**
     * 根据订单ID查询订单明细
     *
     * @param orderId 订单ID
     * @return 订单明细列表
     */
    List<OrderDetail> selectOrderDetailList(Long orderId);

    /**
     * 根据订单ID查询订单减免明细
     *
     * @param orderId 订单ID
     * @return 订单减免明细列表
     */
    List<OrderDerate> selectOrderDerateList(Long orderId);
}
